﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:primitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:localControls="clr-namespace:mal.WP7.Framework.Controls">

    <Style TargetType="localControls:TimePicker">
        <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="PickerPageUri" Value="/mal.WP7.Framework;component/Controls/TimePickerPage.xaml"/>
        <!-- Ideally, the short time pattern 't' would be correct. However, it does not respect
             the system's "24-hour clock" setting override and so the correct effective value of
             ValueStringFormat is determined on an as-needed basis (unless overridden). -->
        <!--<Setter Property="ValueStringFormat" Value="{}{0:t}"/>-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localControls:TimePicker">
                    <StackPanel>
                        <ContentControl
                            Content="{TemplateBinding Header}"
                            ContentTemplate="{TemplateBinding HeaderTemplate}"
                            Foreground="{StaticResource PhoneSubtleBrush}"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            Margin="12,0,12,-4"/>
                        <Button
                            x:Name="DateTimeButton"
                            Content="{TemplateBinding ValueString}"
                            Background="{TemplateBinding Background}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            FontFamily="{TemplateBinding FontFamily}"
                            Foreground="{TemplateBinding Foreground}"
                            Height="72"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
